package JumpGuyViews;

import ag.core.AGEngine;
import ag.core.AGView;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.RectF;
import android.util.Log;
import android.view.MotionEvent;
import Core.Controls.*;

public class ResultView extends AGView {
	
	private RectF _easyLevelRect;
	private RectF _normalLevelRect;
	private RectF _hardLevelRect;
	
	private RectF _titleRect;
	private Bitmap _titleImage;

	private AGButton _btnStageMode;
	private AGButton _btnRandom;

	public ResultView(AGEngine engine) {
		super(engine);
		// TODO Auto-generated constructor stub
		
		_easyLevelRect = new RectF(140, 700, 340, 720);
		_normalLevelRect = new RectF(140, 730, 340, 750);
		_hardLevelRect = new RectF(140, 760, 340, 780);
		
		// 400 182
		this._titleRect = new RectF(40, 200, 440, 382);
		
//		this._btnStageMode = new AGButton(engine, R.drawable.randommode); //258 63
//		this._btnStageMode.rect = new RectF(111, 559, 369, 622);
//		this._btnStageMode.addClickEvent(new OnBtnStageModeClick(this));
//		this.controls.add(this._btnStageMode);
//		
//		this._btnRandom = new AGButton(engine, R.drawable.randommode); //258 63
//		this._btnRandom.rect = new RectF(111, 659, 369, 722);
//		this._btnRandom.addClickEvent(new OnBtnRandomClick(this));
//		this.controls.add(this._btnRandom);
	}

	@Override
	public void onUpdate(AGEngine engine) {
		// TODO Auto-generated method stub
		if(engine.input.Action == MotionEvent.ACTION_DOWN){
			this.switchView(new TestObjectView(engine));
			engine.input.Action = MotionEvent.ACTION_UP;
		}
	}

	@Override
	public void onRender(AGEngine engine) {
		// TODO Auto-generated method stub
        //mPaint.setColor(Color.WHITE); 
		//engine.graphics.drawText("Press screen start", 10.0f, 200.0f, mPaint);

		RectF destRect2 = new RectF(0,0, 480, 840);
		engine.graphics.drawText("JumpBoy", destRect2, engine.graphics.DebugTextPaint);
		//engine.graphics.drawBitmap(destRect2, engine.resource.getImage(R.drawable.home_bg), null);

		//this._titleImage = engine.resource.getImage(R.drawable.home_title);
		//engine.graphics.drawBitmap(this._titleRect, this._titleImage, null);
	}

	class OnBtnStageModeClick implements IAGEventHandler{
		private AGView view;
		public OnBtnStageModeClick(AGView view){
			this.view = view;
		}
		@Override
		public void onHandle(AGControl control) {
			// TODO Auto-generated method stub
			//this.view.switchView(new StageView(this.view.Engine));
		}
	}

	class OnBtnRandomClick implements IAGEventHandler{
		private AGView view;
		public OnBtnRandomClick(AGView view){
			this.view = view;
		}
		@Override
		public void onHandle(AGControl control) {
			// TODO Auto-generated method stub
			//this.view.switchView(new RandomView(this.view.Engine));
		}
	}
}
